<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>登录模块</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/signin.css" rel="stylesheet">

    <script src="js/axios.min.js"></script>
    <script src="js/auth.js"></script>
    <script src="js/vue.js"></script>

</head>
<body>
<div id="app">
    <div class="form-signin">
        <h3 class="form-signin-heading">请登录</h3>
        <p>
            <label for="username" class="sr-only">用户名：</label>
            <input type="text" id="username"  v-model="user.username" class="form-control" >
        </p>
        <p>
            <label for="password" class="sr-only">密码：</label>
            <input type="password" id="password"  v-model="user.password"  class="form-control">
        </p>
        <button class="btn btn-lg btn-primary btn-block" onclick="Auth.login(vue.$data.user)">登录</button>
    </div>

</div>
<script>
    let vue = new Vue({
        el:"#app",
        data:{
            user:{
                username:null,
                password:null
            }
        },
        created(){
            //检测如果登录了，直接进入管理中心
            Auth.gotoManagerCenter(Auth.getToken());
        }
    });

</script>
</body>
</html>